home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 August: Tool Chest / Dev.CD Aug 95 TC / Dev.CD Aug 95 TC.toast / Tool Chest / Interfaces / UniversalInterfaces 2.0 / PInterfaces / ImageCodec.p < prev    next >
Encoding:
Text File  |  1995-04-18  |  7.3 KB  |  244 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        ImageCodec.p
  3.  
  4.      Contains:    QuickTime Interfaces.
  5.  
  6.      Version:    Technology:    QuickTime 2.0
  7.                  Package:    Universal Interfaces 2.0 in “MPW Latest” on ETO #17
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. }
  19.  
  20. {$IFC UNDEFINED UsingIncludes}
  21. {$SETC UsingIncludes := 0}
  22. {$ENDC}
  23.  
  24. {$IFC NOT UsingIncludes}
  25.  UNIT ImageCodec;
  26.  INTERFACE
  27. {$ENDC}
  28.  
  29. {$IFC UNDEFINED __IMAGECODEC__}
  30. {$SETC __IMAGECODEC__ := 1}
  31.  
  32. {$I+}
  33. {$SETC ImageCodecIncludes := UsingIncludes}
  34. {$SETC UsingIncludes := 1}
  35.  
  36.  
  37. {$IFC UNDEFINED __TYPES__}
  38. {$I Types.p}
  39. {$ENDC}
  40. {    ConditionalMacros.p                                            }
  41.  
  42. {$IFC UNDEFINED __QUICKDRAW__}
  43. {$I Quickdraw.p}
  44. {$ENDC}
  45. {    MixedMode.p                                                    }
  46. {    QuickdrawText.p                                                }
  47.  
  48. {$IFC UNDEFINED __QDOFFSCREEN__}
  49. {$I QDOffscreen.p}
  50. {$ENDC}
  51. {    Errors.p                                                    }
  52.  
  53. {$IFC UNDEFINED __WINDOWS__}
  54. {$I Windows.p}
  55. {$ENDC}
  56. {    Memory.p                                                    }
  57. {    Events.p                                                    }
  58. {        OSUtils.p                                                }
  59. {    Controls.p                                                    }
  60. {        Menus.p                                                    }
  61.  
  62. {$IFC UNDEFINED __IMAGECOMPRESSION__}
  63. {$I ImageCompression.p}
  64. {$ENDC}
  65. {    Components.p                                                }
  66. {    StandardFile.p                                                }
  67. {        Dialogs.p                                                }
  68. {            TextEdit.p                                            }
  69. {        Files.p                                                    }
  70.  
  71. {$IFC UNDEFINED __COMPONENTS__}
  72. {$I Components.p}
  73. {$ENDC}
  74.  
  75. {$IFC UNDEFINED __MOVIES__}
  76. {$I Movies.p}
  77. {$ENDC}
  78. {    Aliases.p                                                    }
  79. {        AppleTalk.p                                                }
  80.  
  81. {$PUSH}
  82. {$ALIGN MAC68K}
  83. {$LibExport+}
  84.  
  85. CONST
  86.     codecGetCodecInfo            = $00;
  87.     codecGetCompressionTime        = $01;
  88.     codecGetMaxCompressionSize    = $02;
  89.     codecPreCompress            = $03;
  90.     codecBandCompress            = $04;
  91.     codecPreDecompress            = $05;
  92.     codecBandDecompress            = $06;
  93.     codecCDSequenceBusy            = $07;
  94.     codecGetCompressedImageSize    = $08;
  95.     codecGetSimilarity            = $09;
  96.     codecTrimImage                = $0A;
  97.     codecRequestSettings        = $0B;
  98.     codecGetSettings            = $0C;
  99.     codecSetSettings            = $0D;
  100.     codecCDSequenceFlush        = $0E;
  101.     codecSetTimeCode            = $0F;
  102.  
  103.     codecCanScale                = 1 * (2**(0));
  104.     codecCanMask                = 1 * (2**(1));
  105.     codecCanMatte                = 1 * (2**(2));
  106.     codecCanTransform            = 1 * (2**(3));
  107.     codecCanTransferMode        = 1 * (2**(4));
  108.     codecCanCopyPrev            = 1 * (2**(5));
  109.     codecCanSpool                = 1 * (2**(6));
  110.     codecCanClipVertical        = 1 * (2**(7));
  111.     codecCanClipRectangular        = 1 * (2**(8));
  112.     codecCanRemapColor            = 1 * (2**(9));
  113.     codecCanFastDither            = 1 * (2**(10));
  114.     codecCanSrcExtract            = 1 * (2**(11));
  115.     codecCanCopyPrevComp        = 1 * (2**(12));
  116.     codecCanAsync                = 1 * (2**(13));
  117.     codecCanMakeMask            = 1 * (2**(14));
  118.     codecCanShift                = 1 * (2**(15));
  119.     codecCanAsyncWhen            = 1 * (2**(16));
  120.     codecCanShieldCursor        = 1 * (2**(17));
  121.     codecCanManagePrevBuffer    = 1 * (2**(18));
  122.  
  123.  
  124. TYPE
  125.     CodecCapabilities = RECORD
  126.         flags:                    LONGINT;
  127.         wantedPixelSize:        INTEGER;
  128.         extendWidth:            INTEGER;
  129.         extendHeight:            INTEGER;
  130.         bandMin:                INTEGER;
  131.         bandInc:                INTEGER;
  132.         pad:                    INTEGER;
  133.         time:                    LONGINT;
  134.     END;
  135.  
  136.  
  137. CONST
  138.     codecConditionFirstBand        = 1 * (2**(0));
  139.     codecConditionLastBand        = 1 * (2**(1));
  140.     codecConditionFirstFrame    = 1 * (2**(2));
  141.     codecConditionNewDepth        = 1 * (2**(3));
  142.     codecConditionNewTransform    = 1 * (2**(4));
  143.     codecConditionNewSrcRect    = 1 * (2**(5));
  144.     codecConditionNewMask        = 1 * (2**(6));
  145.     codecConditionNewMatte        = 1 * (2**(7));
  146.     codecConditionNewTransferMode = 1 * (2**(8));
  147.     codecConditionNewClut        = 1 * (2**(9));
  148.     codecConditionNewAccuracy    = 1 * (2**(10));
  149.     codecConditionNewDestination = 1 * (2**(11));
  150.     codecConditionFirstScreen    = 1 * (2**(12));
  151.     codecConditionDoCursor        = 1 * (2**(13));
  152.     codecConditionCatchUpDiff    = 1 * (2**(14));
  153.     codecConditionCodecChangedMask = 1 * (2**(31));
  154.  
  155.     codecInfoResourceType        = 'cdci';
  156.     codecInterfaceVersion        = 2;
  157.  
  158.  
  159. TYPE
  160.     CodecCompressParams = RECORD
  161.         sequenceID:                ImageSequence;
  162.         imageDescription:        ImageDescriptionHandle;
  163.         data:                    Ptr;
  164.         bufferSize:                LONGINT;
  165.         frameNumber:            LONGINT;
  166.         startLine:                LONGINT;
  167.         stopLine:                LONGINT;
  168.         conditionFlags:            LONGINT;
  169.         callerFlags:            CodecFlags;
  170.         capabilities:            ^CodecCapabilities;
  171.         progressProcRecord:        ICMProgressProcRecord;
  172.         completionProcRecord:    ICMCompletionProcRecord;
  173.         flushProcRecord:        ICMFlushProcRecord;
  174.         srcPixMap:                PixMap;
  175.         prevPixMap:                PixMap;
  176.         spatialQuality:            CodecQ;
  177.         temporalQuality:        CodecQ;
  178.         similarity:                Fixed;
  179.         dataRateParams:            DataRateParamsPtr;
  180.         reserved:                LONGINT;
  181.     END;
  182.  
  183.     CodecDecompressParams = RECORD
  184.         sequenceID:                ImageSequence;
  185.         imageDescription:        ImageDescriptionHandle;
  186.         data:                    Ptr;
  187.         bufferSize:                LONGINT;
  188.         frameNumber:            LONGINT;
  189.         startLine:                LONGINT;
  190.         stopLine:                LONGINT;
  191.         conditionFlags:            LONGINT;
  192.         callerFlags:            CodecFlags;
  193.         capabilities:            ^CodecCapabilities;
  194.         progressProcRecord:        ICMProgressProcRecord;
  195.         completionProcRecord:    ICMCompletionProcRecord;
  196.         dataProcRecord:            ICMDataProcRecord;
  197.         port:                    CGrafPtr;
  198.         dstPixMap:                PixMap;
  199.         maskBits:                BitMapPtr;
  200.         mattePixMap:            PixMapPtr;
  201.         srcRect:                Rect;
  202.         matrix:                    ^MatrixRecord;
  203.         accuracy:                CodecQ;
  204.         transferMode:            INTEGER;
  205.         frameTime:                ICMFrameTimePtr;
  206.         reserved:                ARRAY [0..0] OF LONGINT;
  207.         matrixFlags:            SInt8;
  208.         matrixType:                SInt8;
  209.         dstRect:                Rect;
  210.     END;
  211.  
  212.  
  213. CONST
  214.     matrixFlagScale2x            = 1 * (2**(7));
  215.  
  216.  
  217. FUNCTION CDGetCodecInfo(storage: Handle; VAR info: CodecInfo): ComponentResult;
  218. FUNCTION CDGetCompressionTime(storage: Handle; src: PixMapHandle; {CONST}VAR srcRect: Rect; depth: INTEGER; VAR spatialQuality: CodecQ; VAR temporalQuality: CodecQ; VAR time: LONGINT): ComponentResult;
  219. FUNCTION CDGetMaxCompressionSize(storage: Handle; src: PixMapHandle; {CONST}VAR srcRect: Rect; depth: INTEGER; quality: CodecQ; VAR size: LONGINT): ComponentResult;
  220. FUNCTION CDPreCompress(storage: Handle; VAR params: CodecCompressParams): ComponentResult;
  221. FUNCTION CDBandCompress(storage: Handle; VAR params: CodecCompressParams): ComponentResult;
  222. FUNCTION CDPreDecompress(storage: Handle; VAR params: CodecDecompressParams): ComponentResult;
  223. FUNCTION CDBandDecompress(storage: Handle; VAR params: CodecDecompressParams): ComponentResult;
  224. FUNCTION CDCodecBusy(storage: Handle; seq: ImageSequence): ComponentResult;
  225. FUNCTION CDGetCompressedImageSize(storage: Handle; desc: ImageDescriptionHandle; data: Ptr; bufferSize: LONGINT; dataProc: ICMDataProcRecordPtr; VAR dataSize: LONGINT): ComponentResult;
  226. FUNCTION CDGetSimilarity(storage: Handle; src: PixMapHandle; {CONST}VAR srcRect: Rect; desc: ImageDescriptionHandle; data: Ptr; VAR similarity: Fixed): ComponentResult;
  227. FUNCTION CDTrimImage(storage: Handle; Desc: ImageDescriptionHandle; inData: Ptr; inBufferSize: LONGINT; dataProc: ICMDataProcRecordPtr; outData: Ptr; outBufferSize: LONGINT; flushProc: ICMFlushProcRecordPtr; VAR trimRect: Rect; progressProc: ICMProgressProcRecordPtr): ComponentResult;
  228. FUNCTION CDRequestSettings(storage: Handle; settings: Handle; VAR rp: Rect; filterProc: ModalFilterUPP): ComponentResult;
  229. FUNCTION CDGetSettings(storage: Handle; settings: Handle): ComponentResult;
  230. FUNCTION CDSetSettings(storage: Handle; settings: Handle): ComponentResult;
  231. FUNCTION CDCodecFlush(storage: Handle): ComponentResult;
  232. FUNCTION CDCodecSetTimeCode(storage: Handle; timeCodeFormat: UNIV Ptr; timeCodeTime: UNIV Ptr): ComponentResult;
  233.  
  234. {$ALIGN RESET}
  235. {$POP}
  236.  
  237. {$SETC UsingIncludes := ImageCodecIncludes}
  238.  
  239. {$ENDC} {__IMAGECODEC__}
  240.  
  241. {$IFC NOT UsingIncludes}
  242.  END.
  243. {$ENDC}
  244.